<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
{% load i18n %} 
{% load short_uri %}
<html>
<head>
<title>{%block title%}深信服{%endblock%} - SangforCode</title> 
{% block stylesheet %}
{% endblock %}




<link rel="stylesheet" href="http://a.tbcdn.cn/p/global/1.0/global-min.css" />


	<script type="text/javascript" src="/js/sendmsg-min.js"></script>
<script src="http://a.tbcdn.cn/??s/kissy/1.3.0/kissy-min.js,p/global/1.0/global-min.js"></script>
	<script type="text/javascript" src="/js/jquery-1.5.min.js"></script>
	<script type="text/javascript" src="/js/utils.js"></script>
	<script type="text/javascript" src="/js/ajaxcall.js"></script>
	
	<script type="text/javascript">
     
      $(document).ready(function() {
      init_csrf();



      {%if user != current_user%}
      init_send_msg('{{current_user.name}}');
      {%else%}
          $('tr[name^="joined-prj-"]').each(function() {
      	var prj_row = $(this);
      	var prj_name = prj_row.attr('name').substring('joined-prj-'.length);
      	prj_row.find('#exit').confirm('Are you sure exit '+prj_name+'?', 'Yes', 'No', function() {
      	    do_exit(prj_row, prj_name);
      	});
      	
      	var prj_op = prj_row.find('#joined-op');
      	prj_row.find('#accept').click(function() {
      	    do_accept(prj_op, prj_name);
      	});
      	
      	prj_row.find('#reject').confirm('Are you sure reject '+prj_name+'?', 'Yes', 'No', function() {
      	    do_reject(prj_row, prj_name);
      	});
          });
          
          

          $('tr[name^="owner-prj-"]').each(function(){
        	  
         	 	var own_row = $(this);
            	var own_name = own_row.attr('name').substring('owner-prj-'.length);
            	own_row.find('#btn-del').confirm('Are you sure exit '+own_name+'?', 'Yes', 'No', function(){
            	del_prj(own_row, own_name);
            	
            	
            	}
          
          
          
          )
          }  
          )
          
       {%endif%}
      
      
      {%if user.is_authenticated %}
      start_auth_call();
      {%else%}
      start_call();
      {%endif%}
      });
       
      KISSY.config({
        packages:[
            {
                name:"js",
                tag:"20130306",
                path:"/"
            }
        ]
   	  });
   	 
     KISSY.use('js/app/login/login');
      


     function do_pm_op(row, name, op) {
         q_get("prj/"+op+"/"+name, {}, function(result) {
     	row.remove();
         }, function() {
     	show_info('can not '+ op +' '+name);
         });
     }

     function do_exit(row, name) {
         do_pm_op(row, name, "exit");
     }

     function do_accept(row, name) {
         do_pm_op(row, name, "accept");
     }

     function do_reject(row, name) {
         do_pm_op(row, name, "reject");
     }


     function del_prj(row,name) {
         q_get('prj/del/'+ name, {}, function(result) {
     	row.remove();
         }, function() {
     	show_info('can not del project!');
         });
     }

     function watch_project(o,proname) {
     q_get('prj/watch/' + proname, {}, function(r){
     $(o).text(r[0]);
     $('#watch_text').text(r[1]);
     });
     }



     </script>
      

    
    
    
    
{% block extrastyle %}{% endblock %} 
{% block extrascript %}{% endblock %}








</head>
<body>
	
	<div class="d-m-nav">
		<div class="d-m-nav-top layout">
			<a class="d-m-nav-logo" >OpenCode</a>
			<ul class="d-m-main-nav">
			   <li class="first-nav"><a href="http://200.200.0.33" target="_blank">自动化平台</a></li> 
               <li><a href="/project/explore" >{%trans "projects"%}</a></li>
                <li><a href="/p/opencode/wiki/" target="_blank">{%trans "help"%}</a></li>
           	</ul>
			
			<div class="d-m-search">{% include "layouts/user-nav.html" %}
			</div>
		</div>




{% if user.is_authenticated %}

	<link rel="stylesheet" href="/css/user-min.css" />

<div class="d-g-wrapper d-p-user">
	<div class="d-p-user-top">
		<h2 class="d-p-project-name"><a href="/project/explore">{% trans "main" %}</a>&nbsp;&nbsp;>&nbsp;&nbsp;</span><a href="{{current_user|url}}">{{current_user.name}}</a>
		</h2>
		
		<div class="layout d-p-user-info">
			<div class="user-photo">{%gravatar current_user.email current_user.name 105 %}</div>			
			<div class="user-data">
				<span class="user-name">{{current_user.name}}</span><!-- <a href="" class="sina-weibo">{%trans "sinaweibo"%}</a><a href="" class="tqq">{%trans "tweibo"%}</a> -->
				{%if user == current_user and user.is_authenticated%}
					<a href="/my/edit/" class="edit-infor">{%trans "editmy"%}</a><a href="/msg/" class="message-manage">{%trans "message"%}</a>
				{%endif%}
                <p class="user-intro">{{current_user.title}}</p>
                <span class="register-time">{%trans "created"%}{{current_user.ctime|date:"Y-m-d"}}</span>
                {%if user != current_user and user.is_authenticated%}
	                <a id="send-msg" href="javascript:;" class="p-p-project-btn message">{%trans "send message"%}</a>
	                <a href="mailto:{{current_user.email}}" class="p-p-project-btn mail">{%trans "mail"%}</a>
                {%endif%}			
			</div>
		</div>
		{%if user == current_user%}
		<a href="/new/" class="p-p-project-btn add">+&nbsp;&nbsp;{%trans "new create project"%}</a>
	    <ul class="layout d-p-user-tabs">
            <li class="d-p-user-tab"><a href="/my/mypro" {%if current_page == "mypro"%}class="current"{%endif%}>{%trans "myproject"%}</a></li>
            <li class="d-p-user-tab"><a href="/my/watpro" {%if current_page == "watpro"%}class="current"{%endif%}>{%trans "watchedproject"%}</a></li>
            <li class="d-p-user-tab"><a href="/my/worklogs" {%if current_page == "worklogs"%}class="current"{%endif%}>{%trans "worklogs"%}</a></li>
        </ul>
        {%else%}
	    <ul class="layout d-p-user-tabs">
            <li class="d-p-user-tab"><a href="/u/{{current_user}}/mypro" {%if current_page == "mypro"%}class="current"{%endif%}>{%trans "myproject"%}</a></li>
            <li class="d-p-user-tab"><a href="/u/{{current_user}}/watpro" {%if current_page == "watpro"%}class="current"{%endif%}>{%trans "watchedproject"%}</a></li>
            <li class="d-p-user-tab"><a href="/u/{{current_user}}/worklogs" {%if current_page == "worklogs"%}class="current"{%endif%}>{%trans "worklogs"%}</a></li>
        </ul>
        
        {%endif%}
        {%if current_page == "mypro"%}
	        <div class="d-p-user-content d-p-myproject">
	        	 <table>
	                  <tbody>
	                  {%for project in owner_projects%}
	                        <tr name="owner-prj-{{project.name}}">
	                            <td class="td1"><a class="d-g-blue d-p-projectname" href="{{project|url}}">{{project.name}}</a>
	                            	{%if user == current_user%}
	                                <a href="{{project|url}}admin/" class="project-manage">{%trans "projectadmin"%}</a>
	                                <a id="btn-del" href="javascript:;" class="project-delete">{%trans "deleteproject"%}</a>
	                                {%endif%}
	                                <p class="d-p-projectintro">{{project.title}}</p>
	                            </td>   
	                       	</tr> 
	                    {%endfor%}    
	                   	{%for project in joined_projects%}
	                        <tr name="joined-prj-{{project.project.name}}">
	                       
	                            <td class="td1"><a class="d-g-blue d-p-projectname" href="{{project.project|url}}">{{project.project.name}}</a>
	                             	<p class="d-p-projectintro">{{project.project.title}}</p>
	                             	{%if current_user == user and project.member_type == 1 %}
	                             	<a id="exit" href="javascript:;" >{%trans "EXIT"%}</a>
	                             	<span id="joined-op">
		                             	
	                             	{%endif%}
	                             	{%if project.member_type == 0%}
	                             	<span id="joined-op">
											<a id="accept" href="javascript:;">{%trans "ACCEPT"%}</a><br/>
											<a id="reject" href="javascript:;">{%trans "REJECT"%}</a>
		                             	{%endif%} 
	                            </td>	    
	                                               
	                       	</tr> 
	                    {%endfor%}                 
		        		</tbody>
	        		</table>
	        </div>
         {%endif%}
        



        {%if current_page == "watpro"%}
	        <div class="d-p-user-content d-p-myproject">
	        	 <table>
	                  <tbody>
	                  {%for project in watch_projects%}
	                        <tr>
								<td class="td1">
									<a class="d-g-blue d-p-projectname" href="{{project.project|url}}">{{project.project}}</a>
	                                <p class="d-p-projectintro">{{project.project.title}}</p>
	                                <p class="d-p-project-others"><a href="{{project.project.owner|url}}" class="d-g-orange d-p-project-writer">{{project.project.owner}}</a>
	                                {%trans "created"%}{{project.project.ctime|date:"Y-m-d"}}
	                                <span class="d-p-project-lang">{%trans "language:"%}<a href="">{{project.project.language}}</a></span>{% trans "project_member_count" %}: {{project.member_count|default:0}} </p>	
								</td>
	                            <td>
	                            	<a class="d-p-project-praise p-p-project-btn"  href= "javascript:void(0)" onclick="watch_project(this,'{{project.project}}');">{{project.watcher_count|default:0}}</a>	                            	
	                            </td>
	                       	</tr> 
	                       	
	                    {%endfor%}                    
		        		</tbody>
	        		</table>
	        </div>
         {%endif%}
        
        
        
        
        
        
        
		{%if current_page == "worklogs"%}
			<div class="d-p-user-content d-p-myproject">
				<table>
					<tbody>
						{%for log in logs%}
						<tr>
							<td>
							{%include "user/activity.html" with log=log%}
							</td>
						</tr>
						{%endfor%}
					</tbody>
				</table>
			</div>
		{%endif%}

	</div>
	
</div>






{% else %}
<link rel="stylesheet" href="/css/register-min.css" />
<div class="d-g-wrapper d-p-register">

<div id= "J_Slidepic" class ="bg_slide">
        <ul class="ks-switchable-content" >
             <li><a><img src="/img/T1kptUXqFbXXcLtTI3-980-514.gif" /></a></li>
             <li><a><img src="/img/T1kptUXqFbXXcLtTI3-980-514.gif" /></a></li>
             <li><a><img src="/img/T1kptUXqFbXXcLtTI3-980-514.gif" /></a></li>
        </ul>
    </div>
    <div class="statistics">
        <ul>
            <li>{%trans "All projects"%}：{{report.report_cycle}}</li>
            <li>{%trans "All members"%}：{{report.download_times}}</li>
            <li>{%trans "Yesterday commit"%}：{{report.commit_times}}</li>
            <li>{%trans "Yesterday issue"%}：{{report.issue_times}}</li>
        </ul>
    </div>


    <div class="d-p-login-box">
        <h2 class="d-p-register-hd">{%trans "fastregister"%}</h2>
       	<div class="d-p-login-bd">

			<form id="new-user-fast-form" action="/fastregister/" method="post">
			  {% csrf_token %}

			  
			<table>
			  	{{ form.as_table }}
			  	
			    
			 </table>
			      <input type="submit" name="fastnew" value="new" class="J_Submit btn-register"></input>    
			</form>

        <a href="/login/" class="tologin">{%trans "login"%}</a>
        </div>
    </div>
</div>
{% endif %}






	

	
	{% block main-nav %} 
	{% include "layouts/main-nav.html"%}
	
	{% endblock %}
	
	
	{% block body-menu %}
	{% endblock %} 
	
	{% block main-block %}
	{% endblock %} 
	


	<div class="d-m-footer layout">
		<div class="d-m-footer-main layout">
			<dl>
				<dt>{%trans "About Taobao"%}</dt>				
				<dd>
					<a href="/aboutus/">{%trans "About Us"%}</a>
				</dd>
				<dd>
					<a href="/p/opencode/src/">{%trans "Open-source web site"%}</a>
				</dd>
			</dl>
			<dl>
				<dt>{%trans "help center"%}</dt>
				<dd>
					<a href="/p/opencode/wiki/SiteHelp/">{%trans "How to create a project"%}</a>
				</dd>
				<dd>
					<a href="/p/opencode/wiki/SiteHelp/">{%trans "How to become a project member"%}</a>
				</dd>
				<dd>
					<a href="/p/opencode/issues/">{%trans "Issue reponse"%}</a>
				</dd>
			</dl>
			<dl>
				<dt>{%trans "Contact Us"%}</dt>
				<dd>
					<a class="d-m-email" href="mailto:liyang@sangfor.com">{%trans "Email"%}</a> <a
						class="d-m-weibo" href="http://weibo.com/liyang06" target="_blank">{%trans "weibo"%}</a> 
				</dd>
			</dl>
		</div>
		<p class="d-m-right">©&nbsp;&nbsp;2014&nbsp;&nbsp;自动化部门&nbsp;&nbsp;Inc.&nbsp;&nbsp;All&nbsp;&nbsp;rights&nbsp;&nbsp;resvered.</p>
	</div>
	


    <script type="text/javascript">
      var _gaq = _gaq || [];
      _gaq.push(['_setAccount', 'UA-17329683-1']);
      _gaq.push(['_trackPageview']);
      
      (function() {
      var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
      ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
      var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
      })();      
    </script>    

<script type="text/javascript" src="http://js.tongji.linezing.com/2711653/tongji.js"></script><noscript><a href="http://www.linezing.com"><img src="http://img.tongji.linezing.com/2711653/tongji.gif"/></a></noscript>

	</body>
</html>
